<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Body - p2.js</title>
    <link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
    <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
    <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
    <link rel="icon" href="../assets/favicon.ico">
    <script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">

<div id="doc">
    <div id="hd" class="yui3-g header">
        <div class="yui3-u-3-4">
                <h1><img src="../assets/css/logo.png" title="p2.js" width="117" height="52"></h1>
        </div>
        <div class="yui3-u-1-4 version">
            <em>API Docs for: 0.7.1</em>
        </div>
    </div>
    <div id="bd" class="yui3-g">

        <div class="yui3-u-1-4">
            <div id="docs-sidebar" class="sidebar apidocs">
                <div id="api-list">
                    <h2 class="off-left">APIs</h2>
                    <div id="api-tabview" class="tabview">
                        <ul class="tabs">
                            <li><a href="#api-classes">Classes</a></li>
                            <li><a href="#api-modules">Modules</a></li>
                        </ul>
                
                        <div id="api-tabview-filter">
                            <input type="search" id="api-filter" placeholder="Type to filter APIs">
                        </div>
                
                        <div id="api-tabview-panel">
                            <ul id="api-classes" class="apis classes">
                                <li><a href="../classes/AABB.html">AABB</a></li>
                                <li><a href="../classes/AngleLockEquation.html">AngleLockEquation</a></li>
                                <li><a href="../classes/Body.html">Body</a></li>
                                <li><a href="../classes/Box.html">Box</a></li>
                                <li><a href="../classes/Broadphase.html">Broadphase</a></li>
                                <li><a href="../classes/Capsule.html">Capsule</a></li>
                                <li><a href="../classes/Circle.html">Circle</a></li>
                                <li><a href="../classes/Constraint.html">Constraint</a></li>
                                <li><a href="../classes/ContactEquation.html">ContactEquation</a></li>
                                <li><a href="../classes/ContactMaterial.html">ContactMaterial</a></li>
                                <li><a href="../classes/Convex.html">Convex</a></li>
                                <li><a href="../classes/DistanceConstraint.html">DistanceConstraint</a></li>
                                <li><a href="../classes/Equation.html">Equation</a></li>
                                <li><a href="../classes/EventEmitter.html">EventEmitter</a></li>
                                <li><a href="../classes/FrictionEquation.html">FrictionEquation</a></li>
                                <li><a href="../classes/GearConstraint.html">GearConstraint</a></li>
                                <li><a href="../classes/GSSolver.html">GSSolver</a></li>
                                <li><a href="../classes/Heightfield.html">Heightfield</a></li>
                                <li><a href="../classes/Island.html">Island</a></li>
                                <li><a href="../classes/IslandManager.html">IslandManager</a></li>
                                <li><a href="../classes/IslandNode.html">IslandNode</a></li>
                                <li><a href="../classes/Line.html">Line</a></li>
                                <li><a href="../classes/LinearSpring.html">LinearSpring</a></li>
                                <li><a href="../classes/LockConstraint.html">LockConstraint</a></li>
                                <li><a href="../classes/Material.html">Material</a></li>
                                <li><a href="../classes/NaiveBroadphase.html">NaiveBroadphase</a></li>
                                <li><a href="../classes/Narrowphase.html">Narrowphase</a></li>
                                <li><a href="../classes/Object pooling utility..html">Object pooling utility.</a></li>
                                <li><a href="../classes/OverlapKeeper.html">OverlapKeeper</a></li>
                                <li><a href="../classes/OverlapKeeperRecord.html">OverlapKeeperRecord</a></li>
                                <li><a href="../classes/Particle.html">Particle</a></li>
                                <li><a href="../classes/Plane.html">Plane</a></li>
                                <li><a href="../classes/PrismaticConstraint.html">PrismaticConstraint</a></li>
                                <li><a href="../classes/Ray.html">Ray</a></li>
                                <li><a href="../classes/RaycastResult.html">RaycastResult</a></li>
                                <li><a href="../classes/RevoluteConstraint.html">RevoluteConstraint</a></li>
                                <li><a href="../classes/RotationalLockEquation.html">RotationalLockEquation</a></li>
                                <li><a href="../classes/.html"></a></li>
                                <li><a href="../classes/RotationalSpring.html">RotationalSpring</a></li>
                                <li><a href="../classes/RotationalVelocityEquation.html">RotationalVelocityEquation</a></li>
                                <li><a href="../classes/SAPBroadphase.html">SAPBroadphase</a></li>
                                <li><a href="../classes/Shape.html">Shape</a></li>
                                <li><a href="../classes/Solver.html">Solver</a></li>
                                <li><a href="../classes/Spring.html">Spring</a></li>
                                <li><a href="../classes/TopDownVehicle.html">TopDownVehicle</a></li>
                                <li><a href="../classes/TupleDictionary.html">TupleDictionary</a></li>
                                <li><a href="../classes/Utils.html">Utils</a></li>
                                <li><a href="../classes/vec2.html">vec2</a></li>
                                <li><a href="../classes/WheelConstraint.html">WheelConstraint</a></li>
                                <li><a href="../classes/World.html">World</a></li>
                            </ul>
                
                            <ul id="api-modules" class="apis modules">
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="yui3-u-3-4">
                <div id="api-options">
                    Show:
                    <label for="api-show-inherited">
                        <input type="checkbox" id="api-show-inherited" checked>
                        Inherited
                    </label>
            
                    <label for="api-show-protected">
                        <input type="checkbox" id="api-show-protected">
                        Protected
                    </label>
            
                    <label for="api-show-private">
                        <input type="checkbox" id="api-show-private">
                        Private
                    </label>
                    <label for="api-show-deprecated">
                        <input type="checkbox" id="api-show-deprecated">
                        Deprecated
                    </label>
            
                </div>
            
            <div class="apidocs">
                <div id="docs-main">
                    <div class="content">
<h1>Body Class</h1>
<div class="box meta">

        <div class="extends">
            Extends <a href="../classes/EventEmitter.html" class="crosslink">EventEmitter</a>
        </div>

        <div class="foundat">
            Defined in: <a href="../files/src_objects_Body.js.html#l11"><code>src&#x2F;objects&#x2F;Body.js:11</code></a>
        </div>


</div>


<div class="box intro">
    <p>A rigid body. Has got a center of mass, position, velocity and a number of
shapes that are used for collisions.</p>

</div>

    <div class="constructor">
        <h2>Constructor</h2>
        <div id="method_Body" class="method item">
            <h3 class="name"><code>Body</code></h3>
        
                <div class="args">
                    <span class="paren">(</span><ul class="args-list inline commas">
                        <li class="arg">
                                <code class="optional">[options]</code>
                        </li>
                    </ul><span class="paren">)</span>
                </div>
        
        
        
        
        
        
        
        
            <div class="meta">
                        <p>
                        Defined in
                <a href="../files/src_objects_Body.js.html#l11"><code>src&#x2F;objects&#x2F;Body.js:11</code></a>
                </p>
        
        
        
            </div>
        
            <div class="description">
                
            </div>
        
                <div class="params">
                    <h4>Parameters:</h4>
        
                    <ul class="params-list">
                        <li class="param">
                                <code class="param-name optional">[options]</code>
                                <span class="type">Object</span>
                                <span class="flag optional" title="This parameter is optional.">optional</span>
        
        
                            <div class="param-description">
                                 
                            </div>
        
                                <ul class="params-list">
                                    <li class="param">
                                            <code class="param-name optional">[force]</code>
                                            <span class="type">Array</span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            
                                        </div>
        
                                    </li>
                                    <li class="param">
                                            <code class="param-name optional">[position]</code>
                                            <span class="type">Array</span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            
                                        </div>
        
                                    </li>
                                    <li class="param">
                                            <code class="param-name optional">[velocity]</code>
                                            <span class="type">Array</span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            
                                        </div>
        
                                    </li>
                                    <li class="param">
                                            <code class="param-name optional">[allowSleep]</code>
                                            <span class="type">Boolean</span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            
                                        </div>
        
                                    </li>
                                    <li class="param">
                                            <code class="param-name optional">[collisionResponse]</code>
                                            <span class="type">Boolean</span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            
                                        </div>
        
                                    </li>
                                    <li class="param">
                                            <code class="param-name optional">[angle=0]</code>
                                            <span class="type">Number</span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            
                                        </div>
        
                                    </li>
                                    <li class="param">
                                            <code class="param-name optional">[angularForce=0]</code>
                                            <span class="type">Number</span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            
                                        </div>
        
                                    </li>
                                    <li class="param">
                                            <code class="param-name optional">[angularVelocity=0]</code>
                                            <span class="type">Number</span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            
                                        </div>
        
                                    </li>
                                    <li class="param">
                                            <code class="param-name optional">[ccdIterations=10]</code>
                                            <span class="type">Number</span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            
                                        </div>
        
                                    </li>
                                    <li class="param">
                                            <code class="param-name optional">[ccdSpeedThreshold=-1]</code>
                                            <span class="type">Number</span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            
                                        </div>
        
                                    </li>
                                    <li class="param">
                                            <code class="param-name optional">[fixedRotation=false]</code>
                                            <span class="type">Number</span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            
                                        </div>
        
                                    </li>
                                    <li class="param">
                                            <code class="param-name optional">[gravityScale]</code>
                                            <span class="type">Number</span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            
                                        </div>
        
                                    </li>
                                    <li class="param">
                                            <code class="param-name optional">[id]</code>
                                            <span class="type">Number</span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            
                                        </div>
        
                                    </li>
                                    <li class="param">
                                            <code class="param-name optional">[mass=0]</code>
                                            <span class="type">Number</span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            <p>A number &gt;= 0. If zero, the .type will be set to Body.STATIC.</p>
        
                                        </div>
        
                                    </li>
                                    <li class="param">
                                            <code class="param-name optional">[sleepSpeedLimit]</code>
                                            <span class="type">Number</span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            
                                        </div>
        
                                    </li>
                                    <li class="param">
                                            <code class="param-name optional">[sleepTimeLimit]</code>
                                            <span class="type">Number</span>
                                            <span class="flag optional" title="This parameter is optional.">optional</span>
        
                                        <div class="param-description">
                                            
                                        </div>
        
                                    </li>
                                </ul>
                        </li>
                    </ul>
                </div>
        
        
        
                <div class="example">
                    <h4>Example:</h4>
        
                    <div class="example-content">
                        <pre class="code prettyprint"><code>// Create a typical dynamic body
        var body = new Body({
            mass: 1,
            position: [0, 0],
            angle: 0,
            velocity: [0, 0],
            angularVelocity: 0
        });
        
        // Add a circular shape to the body
        body.addShape(new Circle({ radius: 1 }));
        
        // Add the body to the world
        world.addBody(body);
        </code></pre>
                    </div>
                </div>
        </div>
    </div>

<div id="classdocs" class="tabview">
    <ul class="api-class-tabs">
        <li class="api-class-tab index"><a href="#index">Index</a></li>

            <li class="api-class-tab methods"><a href="#methods">Methods</a></li>
            <li class="api-class-tab properties"><a href="#properties">Properties</a></li>
            <li class="api-class-tab events"><a href="#events">Events</a></li>
    </ul>

    <div>
        <div id="index" class="api-class-tabpanel index">
            <h2 class="off-left">Item Index</h2>

                <div class="index-section methods">
                    <h3>Methods</h3>

                    <ul class="index-list methods extends">
                            <li class="index-item method">
                                <a href="#method_addShape">addShape</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_adjustCenterOfMass">adjustCenterOfMass</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_applyDamping">applyDamping</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_applyForce">applyForce</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_applyForceLocal">applyForceLocal</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_applyImpulse">applyImpulse</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_applyImpulseLocal">applyImpulseLocal</a>

                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_emit">emit</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_fromPolygon">fromPolygon</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_getAABB">getAABB</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_getArea">getArea</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_getVelocityAtPoint">getVelocityAtPoint</a>

                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_has">has</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_integrate">integrate</a>

                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_off">off</a>

                            </li>
                            <li class="index-item method inherited">
                                <a href="#method_on">on</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_overlaps">overlaps</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_removeShape">removeShape</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_setDensity">setDensity</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_setZeroForce">setZeroForce</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_sleep">sleep</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_sleepTick">sleepTick</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_toLocalFrame">toLocalFrame</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_toWorldFrame">toWorldFrame</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_updateAABB">updateAABB</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_updateBoundingRadius">updateBoundingRadius</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_updateMassProperties">updateMassProperties</a>

                            </li>
                            <li class="index-item method private">
                                <a href="#method_updateSolveMassProperties">updateSolveMassProperties</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_vectorToLocalFrame">vectorToLocalFrame</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_vectorToWorldFrame">vectorToWorldFrame</a>

                            </li>
                            <li class="index-item method">
                                <a href="#method_wakeUp">wakeUp</a>

                            </li>
                    </ul>
                </div>

                <div class="index-section properties">
                    <h3>Properties</h3>

                    <ul class="index-list properties extends">
                            <li class="index-item property">
                                <a href="#property_aabb">aabb</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_aabbNeedsUpdate">aabbNeedsUpdate</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_allowSleep">allowSleep</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_angle">angle</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_angularDamping">angularDamping</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_angularForce">angularForce</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_angularVelocity">angularVelocity</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_AWAKE">AWAKE</a>

                                    <span class="flag static">static</span>
                            </li>
                            <li class="index-item property">
                                <a href="#property_boundingRadius">boundingRadius</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_ccdIterations">ccdIterations</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_ccdSpeedThreshold">ccdSpeedThreshold</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_collisionResponse">collisionResponse</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_damping">damping</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_DYNAMIC">DYNAMIC</a>

                                    <span class="flag static">static</span>
                            </li>
                            <li class="index-item property">
                                <a href="#property_fixedRotation">fixedRotation</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_fixedX">fixedX</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_fixedY">fixedY</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_force">force</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_gravityScale">gravityScale</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_id">id</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_idleTime">idleTime</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_inertia">inertia</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_interpolatedAngle">interpolatedAngle</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_interpolatedPosition">interpolatedPosition</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_invInertia">invInertia</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_invMass">invMass</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_KINEMATIC">KINEMATIC</a>

                                    <span class="flag static">static</span>
                            </li>
                            <li class="index-item property">
                                <a href="#property_mass">mass</a>

                            </li>
                            <li class="index-item property private">
                                <a href="#property_massMultiplier">massMultiplier</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_position">position</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_previousAngle">previousAngle</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_previousPosition">previousPosition</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_shapes">shapes</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_SLEEPING">SLEEPING</a>

                                    <span class="flag static">static</span>
                            </li>
                            <li class="index-item property">
                                <a href="#property_sleepSpeedLimit">sleepSpeedLimit</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_sleepState">sleepState</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_sleepTimeLimit">sleepTimeLimit</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_SLEEPY">SLEEPY</a>

                                    <span class="flag static">static</span>
                            </li>
                            <li class="index-item property">
                                <a href="#property_STATIC">STATIC</a>

                                    <span class="flag static">static</span>
                            </li>
                            <li class="index-item property private">
                                <a href="#property_timeLastSleepy">timeLastSleepy</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_type">type</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_velocity">velocity</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_vlambda">vlambda</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_wlambda">wlambda</a>

                            </li>
                            <li class="index-item property">
                                <a href="#property_world">world</a>

                            </li>
                    </ul>
                </div>


                <div class="index-section events">
                    <h3>Events</h3>

                    <ul class="index-list events extends">
                            <li class="index-item event">
                                <a href="#event_sleep">sleep</a>

                            </li>
                            <li class="index-item event">
                                <a href="#event_sleepy">sleepy</a>

                            </li>
                            <li class="index-item event">
                                <a href="#event_wakeup">wakeup</a>

                            </li>
                    </ul>
                </div>
        </div>

            <div id="methods" class="api-class-tabpanel">
                <h2 class="off-left">Methods</h2>

<div id="method_addShape" class="method item">
    <h3 class="name"><code>addShape</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>shape</code>
                </li>
                <li class="arg">
                        <code class="optional">[offset]</code>
                </li>
                <li class="arg">
                        <code class="optional">[angle]</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l529"><code>src&#x2F;objects&#x2F;Body.js:529</code></a>
        </p>



    </div>

    <div class="description">
        <p>Add a shape to the body. You can pass a local transform when adding a shape,
so that the shape gets an offset and angle relative to the body center of mass.
Will automatically update the mass properties and bounding radius.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">shape</code>
                        <span class="type"><a href="../classes/Shape.html" class="crosslink">Shape</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name optional">[offset]</code>
                        <span class="type">Array</span>
                        <span class="flag optional" title="This parameter is optional.">optional</span>


                    <div class="param-description">
                        <p>Local body offset of the shape.</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name optional">[angle]</code>
                        <span class="type">Number</span>
                        <span class="flag optional" title="This parameter is optional.">optional</span>


                    <div class="param-description">
                        <p>Local body angle.</p>

                    </div>

                </li>
            </ul>
        </div>



        <div class="example">
            <h4>Example:</h4>

            <div class="example-content">
                <pre class="code prettyprint"><code>var body = new Body(),
    shape = new Circle({ radius: 1 });

// Add the shape to the body, positioned in the center
body.addShape(shape);

// Add another shape to the body, positioned 1 unit length from the body center of mass along the local x-axis.
body.addShape(shape,[1,0]);

// Add another shape to the body, positioned 1 unit length from the body center of mass along the local y-axis, and rotated 90 degrees CCW.
body.addShape(shape,[0,1],Math.PI/2);
</code></pre>
            </div>
        </div>
</div>
<div id="method_adjustCenterOfMass" class="method item">
    <h3 class="name"><code>adjustCenterOfMass</code></h3>

        <span class="paren">()</span>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l858"><code>src&#x2F;objects&#x2F;Body.js:858</code></a>
        </p>



    </div>

    <div class="description">
        <p>Moves the shape offsets so their center of mass becomes the body center of mass.</p>

    </div>




</div>
<div id="method_applyDamping" class="method item">
    <h3 class="name"><code>applyDamping</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>dt</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l919"><code>src&#x2F;objects&#x2F;Body.js:919</code></a>
        </p>



    </div>

    <div class="description">
        <p>Apply damping, see <a href="http://code.google.com/p/bullet/issues/detail?id=74">this</a> for details.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">dt</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                        <p>Current time step</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_applyForce" class="method item">
    <h3 class="name"><code>applyForce</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>force</code>
                </li>
                <li class="arg">
                        <code class="optional">[relativePoint]</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l646"><code>src&#x2F;objects&#x2F;Body.js:646</code></a>
        </p>



    </div>

    <div class="description">
        <p>Apply force to a point relative to the center of mass of the body. This could for example be a point on the RigidBody surface. Applying force this way will add to Body.force and Body.angularForce. If relativePoint is zero, the force will be applied directly on the center of mass, and the torque produced will be zero.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">force</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        <p>The force to add.</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name optional">[relativePoint]</code>
                        <span class="type">Array</span>
                        <span class="flag optional" title="This parameter is optional.">optional</span>


                    <div class="param-description">
                        <p>A world point to apply the force on.</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_applyForceLocal" class="method item">
    <h3 class="name"><code>applyForceLocal</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>localForce</code>
                </li>
                <li class="arg">
                        <code class="optional">[localPoint]</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l667"><code>src&#x2F;objects&#x2F;Body.js:667</code></a>
        </p>



    </div>

    <div class="description">
        <p>Apply force to a body-local point.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">localForce</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        <p>The force vector to add, oriented in local body space.</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name optional">[localPoint]</code>
                        <span class="type">Array</span>
                        <span class="flag optional" title="This parameter is optional.">optional</span>


                    <div class="param-description">
                        <p>A point relative to the body in world space. If not given, it is set to zero and all of the impulse will be excerted on the center of mass.</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_applyImpulse" class="method item">
    <h3 class="name"><code>applyImpulse</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>impulse</code>
                </li>
                <li class="arg">
                        <code class="optional">[relativePoint]</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l685"><code>src&#x2F;objects&#x2F;Body.js:685</code></a>
        </p>



    </div>

    <div class="description">
        <p>Apply impulse to a point relative to the body. This could for example be a point on the Body surface. An impulse is a force added to a body during a short period of time (impulse = force * time). Impulses will be added to Body.velocity and Body.angularVelocity.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">impulse</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        <p>The impulse vector to add, oriented in world space.</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name optional">[relativePoint]</code>
                        <span class="type">Array</span>
                        <span class="flag optional" title="This parameter is optional.">optional</span>


                    <div class="param-description">
                        <p>A point relative to the body in world space. If not given, it is set to zero and all of the impulse will be excerted on the center of mass.</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_applyImpulseLocal" class="method item">
    <h3 class="name"><code>applyImpulseLocal</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>impulse</code>
                </li>
                <li class="arg">
                        <code class="optional">[relativePoint]</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l715"><code>src&#x2F;objects&#x2F;Body.js:715</code></a>
        </p>



    </div>

    <div class="description">
        <p>Apply impulse to a point relative to the body. This could for example be a point on the Body surface. An impulse is a force added to a body during a short period of time (impulse = force * time). Impulses will be added to Body.velocity and Body.angularVelocity.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">impulse</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        <p>The impulse vector to add, oriented in world space.</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name optional">[relativePoint]</code>
                        <span class="type">Array</span>
                        <span class="flag optional" title="This parameter is optional.">optional</span>


                    <div class="param-description">
                        <p>A point relative to the body in world space. If not given, it is set to zero and all of the impulse will be excerted on the center of mass.</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_emit" class="method item inherited">
    <h3 class="name"><code>emit</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>event</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type"><a href="../classes/EventEmitter.html" class="crosslink">EventEmitter</a></span>
        </span>







    <div class="meta">
                <p>Inherited from
                <a href="../classes/EventEmitter.html#method_emit">EventEmitter</a>:
        <a href="../files/src_events_EventEmitter.js.html#l79"><code>src&#x2F;events&#x2F;EventEmitter.js:79</code></a>
        </p>



    </div>

    <div class="description">
        <p>Emit an event.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">event</code>
                        <span class="type">Object</span>


                    <div class="param-description">
                        
                    </div>

                        <ul class="params-list">
                            <li class="param">
                                    <code class="param-name">type</code>
                                    <span class="type">String</span>

                                <div class="param-description">
                                    
                                </div>

                            </li>
                        </ul>
                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type"><a href="../classes/EventEmitter.html" class="crosslink">EventEmitter</a></span>:
                    <p>The self object, for chainability.</p>

            </div>
        </div>


</div>
<div id="method_fromPolygon" class="method item">
    <h3 class="name"><code>fromPolygon</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>path</code>
                </li>
                <li class="arg">
                        <code class="optional">[options]</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Boolean</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l773"><code>src&#x2F;objects&#x2F;Body.js:773</code></a>
        </p>



    </div>

    <div class="description">
        <p>Reads a polygon shape path, and assembles convex shapes from that and puts them at proper offset points.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">path</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        <p>An array of 2d vectors, e.g. [[0,0],[0,1],...] that resembles a concave or convex polygon. The shape must be simple and without holes.</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name optional">[options]</code>
                        <span class="type">Object</span>
                        <span class="flag optional" title="This parameter is optional.">optional</span>


                    <div class="param-description">
                         
                    </div>

                        <ul class="params-list">
                            <li class="param">
                                    <code class="param-name optional">[optimalDecomp=false]</code>
                                    <span class="type">Boolean</span>
                                    <span class="flag optional" title="This parameter is optional.">optional</span>

                                <div class="param-description">
                                    <p>Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices.</p>

                                </div>

                            </li>
                            <li class="param">
                                    <code class="param-name optional">[skipSimpleCheck=false]</code>
                                    <span class="type">Boolean</span>
                                    <span class="flag optional" title="This parameter is optional.">optional</span>

                                <div class="param-description">
                                    <p>Set to true if you already know that the path is not intersecting itself.</p>

                                </div>

                            </li>
                            <li class="param">
                                    <code class="param-name optional">[removeCollinearPoints=false]</code>
                                    <span class="type">Boolean | Number</span>
                                    <span class="flag optional" title="This parameter is optional.">optional</span>

                                <div class="param-description">
                                    <p>Set to a number (angle threshold value) to remove collinear points, or false to keep all points.</p>

                                </div>

                            </li>
                        </ul>
                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Boolean</span>:
                    <p>True on success, else false.</p>

            </div>
        </div>


</div>
<div id="method_getAABB" class="method item">
    <h3 class="name"><code>getAABB</code></h3>

        <span class="paren">()</span>

        <span class="returns-inline">
            <span class="type"><a href="../classes/AABB.html" class="crosslink">AABB</a></span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l462"><code>src&#x2F;objects&#x2F;Body.js:462</code></a>
        </p>



    </div>

    <div class="description">
        <p>Get the AABB from the body. The AABB is updated if necessary.</p>

    </div>


        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type"><a href="../classes/AABB.html" class="crosslink">AABB</a></span>:
                    <p>The AABB instance (this.aabb)</p>

            </div>
        </div>


</div>
<div id="method_getArea" class="method item">
    <h3 class="name"><code>getArea</code></h3>

        <span class="paren">()</span>

        <span class="returns-inline">
            <span class="type">Number</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l449"><code>src&#x2F;objects&#x2F;Body.js:449</code></a>
        </p>



    </div>

    <div class="description">
        <p>Get the total area of all shapes in the body</p>

    </div>


        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Number</span>:
            </div>
        </div>


</div>
<div id="method_getVelocityAtPoint" class="method item">
    <h3 class="name"><code>getVelocityAtPoint</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>result</code>
                </li>
                <li class="arg">
                        <code>relativePoint</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Array</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l1138"><code>src&#x2F;objects&#x2F;Body.js:1138</code></a>
        </p>



    </div>

    <div class="description">
        <p>Get velocity of a point in the body.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">result</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        <p>A vector to store the result in</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">relativePoint</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        <p>A world oriented vector, indicating the position of the point to get the velocity from</p>

                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Array</span>:
                    <p>The result vector</p>

            </div>
        </div>


</div>
<div id="method_has" class="method item inherited">
    <h3 class="name"><code>has</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>type</code>
                </li>
                <li class="arg">
                        <code>listener</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Boolean</span>
        </span>







    <div class="meta">
                <p>Inherited from
                <a href="../classes/EventEmitter.html#method_has">EventEmitter</a>:
        <a href="../files/src_events_EventEmitter.js.html#l35"><code>src&#x2F;events&#x2F;EventEmitter.js:35</code></a>
        </p>



    </div>

    <div class="description">
        <p>Check if an event listener is added</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">type</code>
                        <span class="type">String</span>


                    <div class="param-description">
                        
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">listener</code>
                        <span class="type">Function</span>


                    <div class="param-description">
                        
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Boolean</span>:
            </div>
        </div>


</div>
<div id="method_integrate" class="method item">
    <h3 class="name"><code>integrate</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>dt</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l1007"><code>src&#x2F;objects&#x2F;Body.js:1007</code></a>
        </p>



    </div>

    <div class="description">
        <p>Move the body forward in time given its current velocity.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">dt</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_off" class="method item inherited">
    <h3 class="name"><code>off</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>type</code>
                </li>
                <li class="arg">
                        <code>listener</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type"><a href="../classes/EventEmitter.html" class="crosslink">EventEmitter</a></span>
        </span>







    <div class="meta">
                <p>Inherited from
                <a href="../classes/EventEmitter.html#method_off">EventEmitter</a>:
        <a href="../files/src_events_EventEmitter.js.html#l60"><code>src&#x2F;events&#x2F;EventEmitter.js:60</code></a>
        </p>



    </div>

    <div class="description">
        <p>Remove an event listener</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">type</code>
                        <span class="type">String</span>


                    <div class="param-description">
                        
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">listener</code>
                        <span class="type">Function</span>


                    <div class="param-description">
                        
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type"><a href="../classes/EventEmitter.html" class="crosslink">EventEmitter</a></span>:
                    <p>The self object, for chainability.</p>

            </div>
        </div>


</div>
<div id="method_on" class="method item inherited">
    <h3 class="name"><code>on</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>type</code>
                </li>
                <li class="arg">
                        <code>listener</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type"><a href="../classes/EventEmitter.html" class="crosslink">EventEmitter</a></span>
        </span>







    <div class="meta">
                <p>Inherited from
                <a href="../classes/EventEmitter.html#method_on">EventEmitter</a>:
        <a href="../files/src_events_EventEmitter.js.html#l13"><code>src&#x2F;events&#x2F;EventEmitter.js:13</code></a>
        </p>



    </div>

    <div class="description">
        <p>Add an event listener</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">type</code>
                        <span class="type">String</span>


                    <div class="param-description">
                        
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">listener</code>
                        <span class="type">Function</span>


                    <div class="param-description">
                        
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type"><a href="../classes/EventEmitter.html" class="crosslink">EventEmitter</a></span>:
                    <p>The self object, for chainability.</p>

            </div>
        </div>


</div>
<div id="method_overlaps" class="method item">
    <h3 class="name"><code>overlaps</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>body</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Boolean</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l994"><code>src&#x2F;objects&#x2F;Body.js:994</code></a>
        </p>



    </div>

    <div class="description">
        <p>Check if the body is overlapping another body. Note that this method only works if the body was added to a World and if at least one step was taken.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">body</code>
                        <span class="type"><a href="../classes/Body.html" class="crosslink">Body</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Boolean</span>:
            </div>
        </div>


</div>
<div id="method_removeShape" class="method item">
    <h3 class="name"><code>removeShape</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>shape</code>
                </li>
            </ul><span class="paren">)</span>
        </div>

        <span class="returns-inline">
            <span class="type">Boolean</span>
        </span>







    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l574"><code>src&#x2F;objects&#x2F;Body.js:574</code></a>
        </p>



    </div>

    <div class="description">
        <p>Remove a shape</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">shape</code>
                        <span class="type"><a href="../classes/Shape.html" class="crosslink">Shape</a></span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>

        <div class="returns">
            <h4>Returns:</h4>

            <div class="returns-description">
                        <span class="type">Boolean</span>:
                    <p>True if the shape was found and removed, else false.</p>

            </div>
        </div>


</div>
<div id="method_setDensity" class="method item">
    <h3 class="name"><code>setDensity</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>density</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l438"><code>src&#x2F;objects&#x2F;Body.js:438</code></a>
        </p>



    </div>

    <div class="description">
        <p>Set the total density of the body</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">density</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_setZeroForce" class="method item">
    <h3 class="name"><code>setZeroForce</code></h3>

        <span class="paren">()</span>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l896"><code>src&#x2F;objects&#x2F;Body.js:896</code></a>
        </p>



    </div>

    <div class="description">
        <p>Sets the force on the body to zero.</p>

    </div>




</div>
<div id="method_sleep" class="method item">
    <h3 class="name"><code>sleep</code></h3>

        <span class="paren">()</span>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l946"><code>src&#x2F;objects&#x2F;Body.js:946</code></a>
        </p>



    </div>

    <div class="description">
        <p>Force body sleep</p>

    </div>




</div>
<div id="method_sleepTick" class="method item">
    <h3 class="name"><code>sleepTick</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>time</code>
                </li>
                <li class="arg">
                        <code>dontSleep</code>
                </li>
                <li class="arg">
                        <code>dt</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l959"><code>src&#x2F;objects&#x2F;Body.js:959</code></a>
        </p>



    </div>

    <div class="description">
        <p>Called every timestep to update internal sleep timer and change sleep state if needed.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">time</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                        <p>The world time in seconds</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">dontSleep</code>
                        <span class="type">Boolean</span>


                    <div class="param-description">
                         
                    </div>

                </li>
                <li class="param">
                        <code class="param-name">dt</code>
                        <span class="type">Number</span>


                    <div class="param-description">
                         
                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_toLocalFrame" class="method item">
    <h3 class="name"><code>toLocalFrame</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>out</code>
                </li>
                <li class="arg">
                        <code>worldPoint</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l733"><code>src&#x2F;objects&#x2F;Body.js:733</code></a>
        </p>



    </div>

    <div class="description">
        <p>Transform a world point to local body frame.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">out</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        <p>The vector to store the result in</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">worldPoint</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        <p>The input world point</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_toWorldFrame" class="method item">
    <h3 class="name"><code>toWorldFrame</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>out</code>
                </li>
                <li class="arg">
                        <code>localPoint</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l743"><code>src&#x2F;objects&#x2F;Body.js:743</code></a>
        </p>



    </div>

    <div class="description">
        <p>Transform a local point to world frame.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">out</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        <p>The vector to store the result in</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">localPoint</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        <p>The input local point</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_updateAABB" class="method item">
    <h3 class="name"><code>updateAABB</code></h3>

        <span class="paren">()</span>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l477"><code>src&#x2F;objects&#x2F;Body.js:477</code></a>
        </p>



    </div>

    <div class="description">
        <p>Updates the AABB of the Body, and set .aabbNeedsUpdate = false.</p>

    </div>




</div>
<div id="method_updateBoundingRadius" class="method item">
    <h3 class="name"><code>updateBoundingRadius</code></h3>

        <span class="paren">()</span>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l508"><code>src&#x2F;objects&#x2F;Body.js:508</code></a>
        </p>



    </div>

    <div class="description">
        <p>Update the bounding radius of the body (this.boundingRadius). Should be done if any of the shape dimensions or positions are changed.</p>

    </div>




</div>
<div id="method_updateMassProperties" class="method item">
    <h3 class="name"><code>updateMassProperties</code></h3>

        <span class="paren">()</span>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l593"><code>src&#x2F;objects&#x2F;Body.js:593</code></a>
        </p>



    </div>

    <div class="description">
        <p>Updates .inertia, .invMass, .invInertia for this Body. Should be called when
changing the structure or mass of the Body.</p>

    </div>




        <div class="example">
            <h4>Example:</h4>

            <div class="example-content">
                <pre class="code prettyprint"><code>body.mass += 1;
body.updateMassProperties();
</code></pre>
            </div>
        </div>
</div>
<div id="method_updateSolveMassProperties" class="method item private">
    <h3 class="name"><code>updateSolveMassProperties</code></h3>

        <span class="paren">()</span>



        <span class="flag private">private</span>





    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l424"><code>src&#x2F;objects&#x2F;Body.js:424</code></a>
        </p>



    </div>

    <div class="description">
        
    </div>




</div>
<div id="method_vectorToLocalFrame" class="method item">
    <h3 class="name"><code>vectorToLocalFrame</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>out</code>
                </li>
                <li class="arg">
                        <code>worldVector</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l753"><code>src&#x2F;objects&#x2F;Body.js:753</code></a>
        </p>



    </div>

    <div class="description">
        <p>Transform a world point to local body frame.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">out</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        <p>The vector to store the result in</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">worldVector</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        <p>The input world vector</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_vectorToWorldFrame" class="method item">
    <h3 class="name"><code>vectorToWorldFrame</code></h3>

        <div class="args">
            <span class="paren">(</span><ul class="args-list inline commas">
                <li class="arg">
                        <code>out</code>
                </li>
                <li class="arg">
                        <code>localVector</code>
                </li>
            </ul><span class="paren">)</span>
        </div>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l763"><code>src&#x2F;objects&#x2F;Body.js:763</code></a>
        </p>



    </div>

    <div class="description">
        <p>Transform a local point to world frame.</p>

    </div>

        <div class="params">
            <h4>Parameters:</h4>

            <ul class="params-list">
                <li class="param">
                        <code class="param-name">out</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        <p>The vector to store the result in</p>

                    </div>

                </li>
                <li class="param">
                        <code class="param-name">localVector</code>
                        <span class="type">Array</span>


                    <div class="param-description">
                        <p>The input local vector</p>

                    </div>

                </li>
            </ul>
        </div>



</div>
<div id="method_wakeUp" class="method item">
    <h3 class="name"><code>wakeUp</code></h3>

        <span class="paren">()</span>








    <div class="meta">
                <p>
                Defined in
        <a href="../files/src_objects_Body.js.html#l932"><code>src&#x2F;objects&#x2F;Body.js:932</code></a>
        </p>



    </div>

    <div class="description">
        <p>Wake the body up. Normally you should not need this, as the body is automatically awoken at events such as collisions.
Sets the sleepState to <a href="../classes/Body.html#property_AWAKE" class="crosslink">Body.AWAKE</a> and emits the wakeUp event if the body wasn&#39;t awake before.</p>

    </div>




</div>
            </div>

            <div id="properties" class="api-class-tabpanel">
                <h2 class="off-left">Properties</h2>

                    <div id="property_aabb" class="property item">
                        <h3 class="name"><code>aabb</code></h3>
                        <span class="type"><a href="../classes/AABB.html" class="crosslink">AABB</a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l315"><code>src&#x2F;objects&#x2F;Body.js:315</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Bounding box of this body.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_aabbNeedsUpdate" class="property item">
                        <h3 class="name"><code>aabbNeedsUpdate</code></h3>
                        <span class="type">Boolean</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l322"><code>src&#x2F;objects&#x2F;Body.js:322</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Indicates if the AABB needs update. Update it with <a href="../classes/Body.html#method_updateAABB" class="crosslink">.updateAABB()</a>.</p>
                    
                        </div>
                    
                    
                            <div class="example">
                                <h4>Example:</h4>
                    
                                <div class="example-content">
                                    <pre class="code prettyprint"><code>// Force update the AABB
                    body.aabbNeedsUpdate = true;
                    body.updateAABB();
                    console.log(body.aabbNeedsUpdate); // false
                    </code></pre>
                                </div>
                            </div>
                    
                    </div>
                    <div id="property_allowSleep" class="property item">
                        <h3 class="name"><code>allowSleep</code></h3>
                        <span class="type">Boolean</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l336"><code>src&#x2F;objects&#x2F;Body.js:336</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>If true, the body will automatically fall to sleep. Note that you need to enable sleeping in the <a href="../classes/World.html" class="crosslink">World</a> before anything will happen.</p>
                    
                        </div>
                    
                            <p><strong>Default:</strong> true</p>
                    
                    
                    </div>
                    <div id="property_angle" class="property item">
                        <h3 class="name"><code>angle</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l198"><code>src&#x2F;objects&#x2F;Body.js:198</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The angle of the body, in radians.</p>
                    
                        </div>
                    
                    
                            <div class="example">
                                <h4>Example:</h4>
                    
                                <div class="example-content">
                                    <pre class="code prettyprint"><code>// The angle property is not normalized to the interval 0 to 2*pi, it can be any value.
                    // If you need a value between 0 and 2*pi, use the following function to normalize it.
                    function normalizeAngle(angle){
                        angle = angle % (2*Math.PI);
                        if(angle &lt; 0){
                            angle += (2*Math.PI);
                        }
                        return angle;
                    }
                    </code></pre>
                                </div>
                            </div>
                    
                    </div>
                    <div id="property_angularDamping" class="property item">
                        <h3 class="name"><code>angularDamping</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l261"><code>src&#x2F;objects&#x2F;Body.js:261</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The angular force acting on the body. Should be a value between 0 and 1.</p>
                    
                        </div>
                    
                            <p><strong>Default:</strong> 0.1</p>
                    
                    
                    </div>
                    <div id="property_angularForce" class="property item">
                        <h3 class="name"><code>angularForce</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l246"><code>src&#x2F;objects&#x2F;Body.js:246</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The angular force acting on the body. See <a href="../classes/Body.html#property_force" class="crosslink">force</a>.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_angularVelocity" class="property item">
                        <h3 class="name"><code>angularVelocity</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l215"><code>src&#x2F;objects&#x2F;Body.js:215</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The angular velocity of the body, in radians per second.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_AWAKE" class="property item">
                        <h3 class="name"><code>AWAKE</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                            <span class="flag static">static</span>
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l1196"><code>src&#x2F;objects&#x2F;Body.js:1196</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_boundingRadius" class="property item">
                        <h3 class="name"><code>boundingRadius</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l308"><code>src&#x2F;objects&#x2F;Body.js:308</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Bounding circle radius.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_ccdIterations" class="property item">
                        <h3 class="name"><code>ccdIterations</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l406"><code>src&#x2F;objects&#x2F;Body.js:406</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The number of iterations that should be used when searching for the time of impact during CCD. A larger number will assure that there&#39;s a small penetration on CCD collision, but a small number will give more performance.</p>
                    
                        </div>
                    
                            <p><strong>Default:</strong> 10</p>
                    
                    
                    </div>
                    <div id="property_ccdSpeedThreshold" class="property item">
                        <h3 class="name"><code>ccdSpeedThreshold</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l399"><code>src&#x2F;objects&#x2F;Body.js:399</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>If the body speed exceeds this threshold, CCD (continuous collision detection) will be enabled. Set it to a negative number to disable CCD completely for this body.</p>
                    
                        </div>
                    
                            <p><strong>Default:</strong> -1</p>
                    
                    
                    </div>
                    <div id="property_collisionResponse" class="property item">
                        <h3 class="name"><code>collisionResponse</code></h3>
                        <span class="type">Boolean</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l380"><code>src&#x2F;objects&#x2F;Body.js:380</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Whether to produce contact forces when in contact with other bodies. Note that contacts will be generated, but they will be disabled. That means that this body will move through other bodies, but it will still trigger contact events, etc.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_damping" class="property item">
                        <h3 class="name"><code>damping</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l253"><code>src&#x2F;objects&#x2F;Body.js:253</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The linear damping acting on the body in the velocity direction. Should be a value between 0 and 1.</p>
                    
                        </div>
                    
                            <p><strong>Default:</strong> 0.1</p>
                    
                    
                    </div>
                    <div id="property_DYNAMIC" class="property item">
                        <h3 class="name"><code>DYNAMIC</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                            <span class="flag static">static</span>
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l1172"><code>src&#x2F;objects&#x2F;Body.js:1172</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Dynamic body.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_fixedRotation" class="property item">
                        <h3 class="name"><code>fixedRotation</code></h3>
                        <span class="type">Boolean</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l111"><code>src&#x2F;objects&#x2F;Body.js:111</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Set to true if you want to fix the rotation of the body.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_fixedX" class="property item">
                        <h3 class="name"><code>fixedX</code></h3>
                        <span class="type">Boolean</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l118"><code>src&#x2F;objects&#x2F;Body.js:118</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Set to true if you want to fix the body movement along the X axis. The body will still be able to move along Y.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_fixedY" class="property item">
                        <h3 class="name"><code>fixedY</code></h3>
                        <span class="type">Boolean</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l124"><code>src&#x2F;objects&#x2F;Body.js:124</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Set to true if you want to fix the body movement along the Y axis. The body will still be able to move along X.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_force" class="property item">
                        <h3 class="name"><code>force</code></h3>
                        <span class="type">Array</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l222"><code>src&#x2F;objects&#x2F;Body.js:222</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The force acting on the body. Since the body force (and <a href="../classes/Body.html#property_angularForce" class="crosslink">angularForce</a>) will be zeroed after each step, so you need to set the force before each step.</p>
                    
                        </div>
                    
                    
                            <div class="example">
                                <h4>Example:</h4>
                    
                                <div class="example-content">
                                    <pre class="code prettyprint"><code>// This produces a forcefield of 1 Newton in the positive x direction.
                    for(var i=0; i&lt;numSteps; i++){
                        body.force[0] = 1;
                        world.step(1/60);
                    }
                    </code></pre><pre class="code prettyprint"><code>// This will apply a rotational force on the body
                    for(var i=0; i&lt;numSteps; i++){
                        body.angularForce = -3;
                        world.step(1/60);
                    }
                    </code></pre>
                                </div>
                            </div>
                    
                    </div>
                    <div id="property_gravityScale" class="property item">
                        <h3 class="name"><code>gravityScale</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l373"><code>src&#x2F;objects&#x2F;Body.js:373</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Gravity scaling factor. If you want the body to ignore gravity, set this to zero. If you want to reverse gravity, set it to -1.</p>
                    
                        </div>
                    
                            <p><strong>Default:</strong> 1</p>
                    
                    
                    </div>
                    <div id="property_id" class="property item">
                        <h3 class="name"><code>id</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l58"><code>src&#x2F;objects&#x2F;Body.js:58</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The body identifyer</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_idleTime" class="property item">
                        <h3 class="name"><code>idleTime</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l386"><code>src&#x2F;objects&#x2F;Body.js:386</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>How long the body has been sleeping.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_inertia" class="property item">
                        <h3 class="name"><code>inertia</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l94"><code>src&#x2F;objects&#x2F;Body.js:94</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The inertia of the body around the Z axis.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_interpolatedAngle" class="property item">
                        <h3 class="name"><code>interpolatedAngle</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l153"><code>src&#x2F;objects&#x2F;Body.js:153</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The interpolated angle of the body. Use this for rendering.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_interpolatedPosition" class="property item">
                        <h3 class="name"><code>interpolatedPosition</code></h3>
                        <span class="type">Array</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l146"><code>src&#x2F;objects&#x2F;Body.js:146</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The interpolated position of the body. Use this for rendering.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_invInertia" class="property item">
                        <h3 class="name"><code>invInertia</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l101"><code>src&#x2F;objects&#x2F;Body.js:101</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The inverse inertia of the body.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_invMass" class="property item">
                        <h3 class="name"><code>invMass</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l87"><code>src&#x2F;objects&#x2F;Body.js:87</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The inverse mass of the body.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_KINEMATIC" class="property item">
                        <h3 class="name"><code>KINEMATIC</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                            <span class="flag static">static</span>
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l1188"><code>src&#x2F;objects&#x2F;Body.js:1188</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Kinematic body.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_mass" class="property item">
                        <h3 class="name"><code>mass</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l80"><code>src&#x2F;objects&#x2F;Body.js:80</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The mass of the body.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_massMultiplier" class="property item private">
                        <h3 class="name"><code>massMultiplier</code></h3>
                        <span class="type">Array</span>
                    
                    
                            <span class="flag private">private</span>
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l130"><code>src&#x2F;objects&#x2F;Body.js:130</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_position" class="property item">
                        <h3 class="name"><code>position</code></h3>
                        <span class="type">Array</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l136"><code>src&#x2F;objects&#x2F;Body.js:136</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The position of the body</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_previousAngle" class="property item">
                        <h3 class="name"><code>previousAngle</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l167"><code>src&#x2F;objects&#x2F;Body.js:167</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The previous angle of the body.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_previousPosition" class="property item">
                        <h3 class="name"><code>previousPosition</code></h3>
                        <span class="type">Array</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l160"><code>src&#x2F;objects&#x2F;Body.js:160</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The previous position of the body.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_shapes" class="property item">
                        <h3 class="name"><code>shapes</code></h3>
                        <span class="type">Array</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l72"><code>src&#x2F;objects&#x2F;Body.js:72</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The shapes of the body.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_SLEEPING" class="property item">
                        <h3 class="name"><code>SLEEPING</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                            <span class="flag static">static</span>
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l1210"><code>src&#x2F;objects&#x2F;Body.js:1210</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_sleepSpeedLimit" class="property item">
                        <h3 class="name"><code>sleepSpeedLimit</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l357"><code>src&#x2F;objects&#x2F;Body.js:357</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>If the speed (the norm of the velocity) is smaller than this value, the body is considered sleepy.</p>
                    
                        </div>
                    
                            <p><strong>Default:</strong> 0.2</p>
                    
                    
                    </div>
                    <div id="property_sleepState" class="property item">
                        <h3 class="name"><code>sleepState</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l346"><code>src&#x2F;objects&#x2F;Body.js:346</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>One of <a href="../classes/Body.html#property_AWAKE" class="crosslink">Body.AWAKE</a>, <a href="../classes/Body.html#property_SLEEPY" class="crosslink">Body.SLEEPY</a> and <a href="../classes/Body.html#property_SLEEPING" class="crosslink">Body.SLEEPING</a>.</p>
                    <p>The body is initially Body.AWAKE. If its velocity norm is below .sleepSpeedLimit, the sleepState will become Body.SLEEPY. If the body continues to be Body.SLEEPY for .sleepTimeLimit seconds, it will fall asleep (Body.SLEEPY).</p>
                    
                        </div>
                    
                            <p><strong>Default:</strong> Body.AWAKE</p>
                    
                    
                    </div>
                    <div id="property_sleepTimeLimit" class="property item">
                        <h3 class="name"><code>sleepTimeLimit</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l365"><code>src&#x2F;objects&#x2F;Body.js:365</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>If the body has been sleepy for this sleepTimeLimit seconds, it is considered sleeping.</p>
                    
                        </div>
                    
                            <p><strong>Default:</strong> 1</p>
                    
                    
                    </div>
                    <div id="property_SLEEPY" class="property item">
                        <h3 class="name"><code>SLEEPY</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                            <span class="flag static">static</span>
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l1203"><code>src&#x2F;objects&#x2F;Body.js:1203</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_STATIC" class="property item">
                        <h3 class="name"><code>STATIC</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                            <span class="flag static">static</span>
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l1180"><code>src&#x2F;objects&#x2F;Body.js:1180</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Static body.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_timeLastSleepy" class="property item private">
                        <h3 class="name"><code>timeLastSleepy</code></h3>
                        <span class="type">Number</span>
                    
                    
                            <span class="flag private">private</span>
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l392"><code>src&#x2F;objects&#x2F;Body.js:392</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The last time when the body went to SLEEPY state.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_type" class="property item">
                        <h3 class="name"><code>type</code></h3>
                        <span class="type">Number</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l269"><code>src&#x2F;objects&#x2F;Body.js:269</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The type of motion this body has. Should be one of: <a href="../classes/Body.html#property_STATIC" class="crosslink">Body.STATIC</a>, <a href="../classes/Body.html#property_DYNAMIC" class="crosslink">Body.DYNAMIC</a> and <a href="../classes/Body.html#property_KINEMATIC" class="crosslink">Body.KINEMATIC</a>.</p>
                    <ul>
                    <li>Static bodies do not move, and they do not respond to forces or collision.</li>
                    <li>Dynamic bodies body can move and respond to collisions and forces.</li>
                    <li>Kinematic bodies only moves according to its .velocity, and does not respond to collisions or force.</li>
                    </ul>
                    
                        </div>
                    
                    
                            <div class="example">
                                <h4>Example:</h4>
                    
                                <div class="example-content">
                                    <pre class="code prettyprint"><code>// Bodies are static by default. Static bodies will never move.
                    var body = new Body();
                    console.log(body.type == Body.STATIC); // true
                    </code></pre><pre class="code prettyprint"><code>// By setting the mass of a body to a nonzero number, the body
                    // will become dynamic and will move and interact with other bodies.
                    var dynamicBody = new Body({
                        mass : 1
                    });
                    console.log(dynamicBody.type == Body.DYNAMIC); // true
                    </code></pre><pre class="code prettyprint"><code>// Kinematic bodies will only move if you change their velocity.
                    var kinematicBody = new Body({
                        type: Body.KINEMATIC // Type can be set via the options object.
                    });
                    </code></pre>
                                </div>
                            </div>
                    
                    </div>
                    <div id="property_velocity" class="property item">
                        <h3 class="name"><code>velocity</code></h3>
                        <span class="type">Array</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l174"><code>src&#x2F;objects&#x2F;Body.js:174</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The current velocity of the body.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_vlambda" class="property item">
                        <h3 class="name"><code>vlambda</code></h3>
                        <span class="type">Array</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l184"><code>src&#x2F;objects&#x2F;Body.js:184</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Constraint velocity that was added to the body during the last step.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_wlambda" class="property item">
                        <h3 class="name"><code>wlambda</code></h3>
                        <span class="type">Array</span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l191"><code>src&#x2F;objects&#x2F;Body.js:191</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>Angular constraint velocity that was added to the body during last step.</p>
                    
                        </div>
                    
                    
                    
                    </div>
                    <div id="property_world" class="property item">
                        <h3 class="name"><code>world</code></h3>
                        <span class="type"><a href="../classes/World.html" class="crosslink">World</a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l65"><code>src&#x2F;objects&#x2F;Body.js:65</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            <p>The world that this body is added to. This property is set to NULL if the body is not added to any world.</p>
                    
                        </div>
                    
                    
                    
                    </div>
            </div>


            <div id="events" class="api-class-tabpanel">
                <h2 class="off-left">Events</h2>

                    <div id="event_sleep" class="events item">
                        <h3 class="name"><code>sleep</code></h3>
                        <span class="type"><a href="../classes/.html" class="crosslink"></a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l1158"><code>src&#x2F;objects&#x2F;Body.js:1158</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            
                        </div>
                    
                    
                    
                    </div>
                    <div id="event_sleepy" class="events item">
                        <h3 class="name"><code>sleepy</code></h3>
                        <span class="type"><a href="../classes/.html" class="crosslink"></a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l1151"><code>src&#x2F;objects&#x2F;Body.js:1151</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            
                        </div>
                    
                    
                    
                    </div>
                    <div id="event_wakeup" class="events item">
                        <h3 class="name"><code>wakeup</code></h3>
                        <span class="type"><a href="../classes/.html" class="crosslink"></a></span>
                    
                    
                    
                    
                    
                        <div class="meta">
                                    <p>
                                    Defined in
                            <a href="../files/src_objects_Body.js.html#l1165"><code>src&#x2F;objects&#x2F;Body.js:1165</code></a>
                            </p>
                    
                    
                        </div>
                    
                        <div class="description">
                            
                        </div>
                    
                    
                    
                    </div>
            </div>
    </div>
</div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>
